#ifndef _RENDERPIPLINE_H_
#define _RENDERPIPLINE_H_

#include <SECore/Plugin.h>
#include <SERender/Renderer/Renderer.h>
#include <SERender/Renderer/RenderPass/RenderPass.h>

namespace SEngine
{
    class RenderPipline : public IPlugin
    {
    public:
        RenderPipline(Renderer & renderer) : m_renderer(renderer) {}
        virtual ~RenderPipline() = default;
        template<typename T, typename... Args>
        RenderPipline & NextPass(Args&&... args) 
        {
            m_renderer.Descriptor<RenderPass>::AddDescriptor(std::make_unique<T>(m_renderer, std::forward<Args>(args)...));
            return *this;
        }
        template<typename T, typename... Args>
        RenderPipline & AddField(Args&&... args) {
            m_renderer.AnyDescriptor::AddDescriptor<T>(std::forward<Args>(args)...);
            return *this;
        }
        virtual void Build() {}
        void Reset() { m_renderer.Descriptor<RenderPass>::Clear(); m_renderer.AnyDescriptor::Clear(); }
    protected:
        Renderer & m_renderer;
    };
} // namespace SEngine


#endif